package orz.mikeneck.server.locrec.controller;

import java.util.List;

import javax.jdo.PersistenceManager;
import javax.jdo.Query;
import javax.servlet.http.HttpServletResponse;

import orz.mikeneck.server.locrec.model.LocRecUserModel;
import orz.mikeneck.server.locrec.model.LocRecUserModelImpl;
import orz.mikeneck.server.locrec.persistent.LocRecUser;
import orz.mikeneck.server.locrec.persistent.utils.PersistenceManagerUtil;

public class LocRecAdminControllerImpl implements
		LocRecController<List<LocRecUser>> {

	@SuppressWarnings("unchecked")
	@Override
	public List<LocRecUser> execute(HttpServletResponse resp) {
		PersistenceManager manager = PersistenceManagerUtil.getManager();
		LocRecUserModel model = new LocRecUserModelImpl();
		Query query = model
			.persistenceManagerIs(manager)
			.createAdminQuery();
		return (List<LocRecUser>) query.execute();
	}

}
